
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>

</head>
<body>
<form action="/admin/product/addimg" method="post" enctype='multipart/form-data'>

    名字：

    <input  type="file" name="photos[]" multiple="multiple" >

    <input type="hidden" name="id" id="" value="8">
    {{--<input type="hidden" name="path" id="" value="0,">--}}
    <input type="hidden" name="_token" id="" value="{{ csrf_token()  }}">
    <input type="submit" value="submit" >

</form>

</body>
<!-- Mainly scripts -->
<script src="{{ asset('myadmin/js/jquery-2.1.1.min.js') }}"></script>
<script src="{{ asset('myadmin/js/bootstrap.min.js?v=3.4.0') }}"></script>
<script src="{{ asset('myadmin/js/plugins/metisMenu/jquery.metisMenu.js') }}"></script>
<script src="{{ asset('myadmin/js/plugins/slimscroll/jquery.slimscroll.min.js') }}"></script>


<script src="{{ asset('myadmin/js/plugins/jeditable/jquery.jeditable.js') }}"></script>

<!-- Data Tables -->
<script src="{{ asset('myadmin/js/plugins/dataTables/jquery.dataTables.js') }}"></script>
<script src="{{ asset('myadmin/js/plugins/dataTables/dataTables.bootstrap.js') }}"></script>


<!-- Flot -->
<script src="{{ asset('myadmin/js/plugins/flot/jquery.flot.js') }}"></script>
<script src="{{ asset('myadmin/js/plugins/flot/jquery.flot.tooltip.min.js') }}"></script>
<script src="{{ asset('myadmin/js/plugins/flot/jquery.flot.spline.js') }}"></script>
<script src="{{ asset('myadmin/js/plugins/flot/jquery.flot.resize.js') }}"></script>
<script src="{{ asset('myadmin/js/plugins/flot/jquery.flot.pie.js') }}"></script>

<!-- Peity -->
<script src="{{ asset('myadmin/js/plugins/peity/jquery.peity.min.js') }}"></script>
<script src="{{ asset('myadmin/js/demo/peity-demo.js') }}"></script>

<!-- Custom and plugin javascript -->
<script src="{{ asset('myadmin/js/hplus.js?v=2.2.0') }}"></script>
<script src="{{ asset('myadmin/js/plugins/pace/pace.min.js') }}"></script>

<!-- jQuery UI -->
<script src="{{ asset('myadmin/js/plugins/jquery-ui/jquery-ui.min.js') }}"></script>

<!-- GITTER -->
<script src="{{ asset('myadmin/js/plugins/gritter/jquery.gritter.min.js') }}"></script>

<!-- EayPIE -->
<script src="{{ asset('myadmin/js/plugins/easypiechart/jquery.easypiechart.js') }}"></script>

<!-- Sparkline -->
<script src="{{ asset('myadmin/js/plugins/sparkline/jquery.sparkline.min.js') }}"></script>

<!-- Sparkline demo data  -->
<script src="{{ asset('myadmin/js/demo/sparkline-demo.js') }}"></script>
<script>
    function demo(){
        $("#img").click();  //隐藏了input:file样式后，点击头像就可以本地上传
        $("#img").on("change",function(){
            var objUrl = getObjectURL(this.files[0]) ; //获取图片的路径，该路径不是图片在本地的路径
            if (objUrl) {
                $("#pic").attr("src", objUrl) ; //将图片路径存入src中，显示出图片
            }
        });
    }


    //建立一個可存取到該file的url
    function getObjectURL(file) {

        var url = null ;
        if (window.createObjectURL!=undefined) { // basic
            url = window.createObjectURL(file) ;
        } else if (window.URL!=undefined) { // mozilla(firefox)
            url = window.URL.createObjectURL(file) ;
        } else if (window.webkitURL!=undefined) { // webkit or chrome
            url = window.webkitURL.createObjectURL(file) ;
        }
        return url ;
    }
</script>
</html>